package com.ruoyi.bizsys.service.impl;

import java.util.List;
import java.util.Arrays;
                                                                                            import com.ruoyi.common.utils.DateUtils;
            import org.springframework.stereotype.Service;
    import com.ruoyi.bizsys.mapper.ZollectionExcludePhoneMapper;
import com.ruoyi.bizsys.domain.ZollectionExcludePhone;
import com.ruoyi.bizsys.service.IZollectionExcludePhoneService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;


/**
 * 催收剔除手机号Service业务层处理
 *
 * @author african-loan
 * @date 2022-02-17
 */
@Service
public class ZollectionExcludePhoneServiceImpl extends ServiceImpl<ZollectionExcludePhoneMapper,ZollectionExcludePhone> implements IZollectionExcludePhoneService {

    /**
     * 查询催收剔除手机号
     *
     * @param id 催收剔除手机号ID
     * @return 催收剔除手机号
     */
    @Override
    public ZollectionExcludePhone selectZollectionExcludePhoneById(Long id) {
        return this.getById(id);
    }

    /**
     * 查询催收剔除手机号列表
     *
     * @param zollectionExcludePhone 催收剔除手机号
     * @return 催收剔除手机号
     */
    @Override
    public List<ZollectionExcludePhone> selectZollectionExcludePhoneList(ZollectionExcludePhone zollectionExcludePhone) {
        return this.list(new QueryWrapper<>(zollectionExcludePhone).last("order by id desc"));
    }

    /**
     * 新增催收剔除手机号
     *
     * @param zollectionExcludePhone 催收剔除手机号
     * @return 结果
     */
            @Override
    public int insertZollectionExcludePhone(ZollectionExcludePhone zollectionExcludePhone) {
                                                                                                                                                            zollectionExcludePhone.setCreateTime(DateUtils.getNowDate());
                                                                    return baseMapper.insert(zollectionExcludePhone);
    }

    /**
     * 修改催收剔除手机号
     *
     * @param zollectionExcludePhone 催收剔除手机号
     * @return 结果
     */
            @Override
    public int updateZollectionExcludePhone(ZollectionExcludePhone zollectionExcludePhone) {
                                                                                                                                                                                                    zollectionExcludePhone.setUpdateTime(DateUtils.getNowDate());
                            return baseMapper.updateById(zollectionExcludePhone);
    }

    /**
     * 批量删除催收剔除手机号
     *
     * @param ids 需要删除的催收剔除手机号ID
     * @return 结果
     */
            @Override
    public int deleteZollectionExcludePhoneByIds(Long[] ids) {
        return baseMapper.deleteBatchIds(Arrays.asList(ids));
    }

    /**
     * 删除催收剔除手机号信息
     *
     * @param id 催收剔除手机号ID
     * @return 结果
     */
    @Override
    public int deleteZollectionExcludePhoneById(Long id) {
        return baseMapper.deleteById(id);
    }

}
